<script language="JavaScript"  type="text/javascript">//<![CDATA[
    function rebilupload()
    {
        $("#upload").html('<input type="hidden" name="MAX_FILE_SIZE" value="<?= Renderer::$var["maximagesize"] ?>" /> <input type="hidden" id="ajax" name="ajax" value="true" /> <input type="file" name="pict" id="pict" /> <input type="submit" value="Upload" />');
    }

    $(document).ready(function() {
        if ($.browser.opera)
        {
            window.history.navigationMode = "fast";
        }

        $("#upload").attr("target", "upload_frame");
        $("#upload").html('<input type="hidden" id="ajax" name="ajax" value="true" />'+$("#upload").html());

 //]]></script>

<div id="main">
    <div id="controls">
        <a href="/images/deleteall" onclick="if(confirm('Are you sure?')) { deleteAll(); return false; } return false;" title="Delete all images">delete all images</a>
        <a href="/images/auth?link=<?= User::$id; ?>" title="Copy link to open it in a other browser" >you auth link</a>
    </div>
    <div id="uploadblock">
        <div id="iframe" style="display: none;">
        <iframe name="upload_frame" id="upload_frame" style="display: none;" src="about:blank"> </iframe>
        </div>

        <form name="upload" id="upload" action="/images/upload" method="post" enctype="multipart/form-data">
            <input type="hidden" name="MAX_FILE_SIZE" value="<?= Renderer::$var["maximagesize"] ?>" />
            
            <input type="file" name="pict" id="pict" />
            <input type="submit" value="Upload" />
        </form>

    </div>
    <div id="images">
        <?php foreach(Renderer::$var["pictures_list"] as $picture): ?>
        <div id="_<?= md5($picture->fullname); ?>" class="image" style="<?= 'width: ',Renderer::$var["imgsize"]["width"]+4,'px; height: ',Renderer::$var["imgsize"]["height"]+23,'px;' ?>" >
            <a href="/images/delete/?i=<?= $picture->basename; ?>" class="imgdelete" title="Delete image" onclick="deleteImage('<?= $picture->basename,"','_",md5($picture->fullname)?>'); return false;">X</a>
            <a href="/<?= $picture->fullname; ?>" class="imgwarper" style="<?= 'width: ',Renderer::$var["imgsize"]["width"],'px; height: ',Renderer::$var["imgsize"]["height"]+1,'px;' ?>">
                <img src="/images/thumb?i=<?= $picture->basename; ?>" alt="<?= $picture->basename; ?>" style="<?= 'width: ',Renderer::$var["imgsize"]["width"],'px; height: ',Renderer::$var["imgsize"]["height"],'px;' ?>" />
            </a>
        </div>
        <?php endforeach; ?>
    </div>
</div>